Skip to content

resolve issues #87, #108, #110: multi-asset tests, reentrancy analysis, api-reference docs#215

Open
Blaqkenny wants to merge 39 commits into
bridgelet-org:mainfrom
Blaqkenny:fix/issues-87-108-110
Open

resolve issues #87, #108, #110: multi-asset tests, reentrancy analysis, api-reference docs#215
Blaqkenny wants to merge 39 commits into
bridgelet-org:mainfrom
Blaqkenny:fix/issues-87-108-110

Conversation

@Blaqkenny

@Blaqkenny Blaqkenny commented Jun 29, 2026

Copy link
Copy Markdown

Summary

Closes #87
Closes #108
Closes #110


Issue #110 — Multi-asset record_payment test coverage

The implementation already supported multi-asset payments; this PR adds dedicated tests:

  • test_multi_asset_record_payment_stores_all_assets: records 3 distinct assets and asserts all appear in get_info() with correct amounts.
  • test_multi_asset_sweep_transitions_state_and_emits_all_payments: records 2 assets, sweeps, and verifies status is Swept and both assets are in the payment list.
  • test_multi_asset_no_payment_after_sweep: confirms that injecting a new asset after sweep and replaying sweep() is blocked by AlreadySwept.

Issue #108 — Reentrancy analysis

  • Added docs/reentrancy-analysis.md documenting the three Soroban properties that prevent reentrancy (single-threaded WASM, atomic storage snapshots, pull-based auth) and the contract-level CEI pattern in sweep().
  • test_reentrancy_sweep_blocked_by_already_swept_guard: simulates a double-sweep (reentrant attack) and asserts AlreadySwept.
  • test_reentrancy_record_payment_then_sweep_replay_blocked: simulates injecting a new payment between sweeps; the second sweep is blocked.

Issue #87 — Complete docs/api-reference.md

Full rewrite of the API reference:

  • All public functions covered: initialize, record_payment, sweep, expire, is_expired, get_status, get_info, reclaim_reserve, and all reserve query functions on EphemeralAccount; initialize, execute_sweep, claim, can_sweep, update_authorized_destination on SweepController.
  • Added missing authorized_controller parameter to EphemeralAccount::initialize.
  • Added authorized_destination parameter and locked/flexible mode documentation for SweepController::initialize.
  • Complete error code tables for both contracts.
  • Signature message format documented for execute_sweep.
  • Usage examples: single-asset, multi-asset, gas-free claim, and full CLI invocations.

What was tested

  • All changes are in test files and documentation only (no production logic modified).
  • New tests follow the existing mock_all_auths pattern used throughout the test suite.
  • Reentrancy tests use try_sweep to assert specific error variants without panicking.

khaadish and others added 30 commits June 21, 2026 18:26
…Initialization

fix(sweep-controller): store creator address during initialization
…erification

fix: Implement real Ed25519 signature verification in verify_sweep_authorization()
…ansfers

feat: Implement token transfers in SweepController
Integrate-wasm-opt-into-the-build-pip
GitHub-Actions-workflow-contract-build-and-test
…pt-into-the-build-pipeline

Integrate-wasm-opt-into-the-build-pip
…nto GitHub-Actions-workflow-contract-build-and-test
fixes
…orkflow-contract-build-and-test

GitHub actions workflow contract build and test
implemented the mutil batch account
auto-deploy-contracts-to-testnet
test: add ephemeral account unit coverage
AJ0070 and others added 9 commits June 27, 2026 09:44
fixes
Experiment: add pre-authorized gas-free claim flow
fixes
…racts-to-testnet

auto-deploy-contracts-to-testnet
… multi-asset tests, reentrancy analysis, api-reference docs

Issue bridgelet-org#110: add dedicated multi-asset record_payment tests
- test_multi_asset_record_payment_stores_all_assets: verifies all 3 assets stored
- test_multi_asset_sweep_transitions_state_and_emits_all_payments: verifies status
- test_multi_asset_no_payment_after_sweep: confirms AlreadySwept blocks replay

Issue bridgelet-org#108: reentrancy analysis and tests
- docs/reentrancy-analysis.md: documents Soroban single-threaded WASM execution,
  snapshot-consistent storage, pull-based auth, and CEI pattern in sweep()
- test_reentrancy_sweep_blocked_by_already_swept_guard: second sweep returns AlreadySwept
- test_reentrancy_record_payment_then_sweep_replay_blocked: record_payment then sweep replay blocked

Issue bridgelet-org#87: complete docs/api-reference.md rewrite
- all public functions documented with full signatures, params, errors, auth requirements
- added missing authorized_controller param to EphemeralAccount::initialize
- added authorized_destination param and locked/flexible mode docs for SweepController
- added update_authorized_destination, reclaim_reserve and all reserve query functions
- complete error code tables for both contracts
- usage examples: single-asset, multi-asset, gas-free claim, CLI invocations

Closes bridgelet-org#87, bridgelet-org#108, bridgelet-org#110
@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@Blaqkenny Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

10 participants